package pl.eurobank.dev.dao;

import java.util.ArrayList;
import java.util.List;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import pl.eurobank.dev.hibernate.utils.HibernateUtil;
import pl.eurobank.dev.model.InvestmentFund;

public class InvestmentFundDAOImpl {

	public List<InvestmentFund> getInvestFundList() {

		Session session = HibernateUtil.getSession();
		List<InvestmentFund> allInvestFunds;

		SQLQuery query = session
				.createSQLQuery("SELECT * FROM INVESTMENT_FUND").addEntity(
						InvestmentFund.class);
		allInvestFunds = (ArrayList<InvestmentFund>) query.list();

		return allInvestFunds;

	}
}
